//导入request.js工具
import request from '@/utils/request.js'

//获取所有患者信息
export const getAllPatientsService = () => {
    return request.get('/admin/patients');
}

//获取所有医生信息
export const getAllDoctorsService = () => {
    return request.get('/admin/doctors');
}

//根据id获取患者信息
export const getPatientByIdService = (id) => {
    return request.get(`/admin/getPatient`, { params: { id } });
}

//根据id获取医生信息
export const getDoctorByIdService = (id) => {
    return request.get(`/admin/getDoctor`, { params: { id } });
}

//更新患者信息
export const updatePatientService = (patient) => {
    return request.put(`/admin/updatePatient`, patient);
}

//更新医生信息
export const updateDoctorService = (doctor) => {
    return request.put(`admin/updateDoctor`, doctor);
}

//删除患者信息
export const deletePatientService = (id) => {
    return request.delete(`/admin/deletePatient`, { params: { id } });
}

//删除医生信息
export const deleteDoctorService = (id) => {
    return request.delete(`/admin/deleteDoctor`, { params: { id } });
}
//获取所有排班表
export const getAllSchedulesService = (scheduleDate, clinicId) => {
    return request.get('/admin/doctorSchedule', { params: { scheduleDate, clinicId } });
}
//更新排班表
export const updateScheduleService = (schedule) => {
    return request.put('/admin/updateDoctorSchedule', schedule);
}
//删除排班表
export const deleteScheduleService = (scheduleId) => {
    return request.delete(`/admin/deleteDoctorSchedule`, { params: { scheduleId } });
}
//添加排班表
export const addScheduleService = (schedule) => {
    return request.post('/admin/addDoctorSchedule', schedule);
}

